package com.heima.wemedia.utils;


import com.heima.model.common.wemedia.entity.WmUser;

public class WmThreadLocalUtil {

    private final static ThreadLocal<WmUser> TL = new ThreadLocal<>();

    /**
     * 添加用户
     * @param wmUser
     */
    public static void  setUser(WmUser wmUser){
        TL.set(wmUser);
    }

    /**
     * 获取用户
     */
    public static WmUser getUser(){
        return TL.get();
    }

    /**
     * 清理用户
     */
    public static void clear(){
        TL.remove();
    }
}